package nowcoder;
/**
 * 69389-倒置字符串
 * https://www.nowcoder.com/practice/ee5de2e7c45a46a090c1ced2fdc62355?tpId=85&&tqId=29867&rp=1&ru=/activity/oj&qru=/ta/2017test/question-ranking
 *
 * 描述
 * 将一句话的单词进行倒置，标点不倒置。比如 I like beijing. 经过函数后变为：beijing. like I
 *
 * 输入：
 * I like beijing.
 * 输出：
 * beijing. like I
 */
import java.util.*;
public class Day02_2 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        // I like beijing.
        String str = input.nextLine();
        // [I, like, beijing.]
        String[] s = str.split(" ");
        StringBuilder sb = new StringBuilder();
        for(int i = s.length - 1; i >= 0; i--){
            sb.append(s[i]);
            sb.append(" ");
        }
        sb.append(s[0]);
        System.out.println(sb.toString());
    }
}
